<template>
  <web-view :src="linkUrl"></web-view>
</template>

<script>
import ShareMixin from '@/mixins/share';
export default {
  mixins: [ShareMixin],
  data() {
    return {
      linkUrl: '',
      title: ''
    };
  },
  onLoad(opt) {
    this.linkUrl = decodeURIComponent(opt.link);
    this.title = opt.title;
    let title = opt.title;
    uni.setNavigationBarTitle({
      title: title
    });
    uni.setNavigationBarColor({
      frontColor: '#ffffff',
      backgroundColor: this.$primaryColor
    });

    this.shareTitle = this.title;
    this.sharePath = `/pagesSub/public/web/index?title=${this.title}&link=${encodeURIComponent(this.linkUrl)}`;
    this.shareQuery = `title=${this.title}&link=${encodeURIComponent(this.linkUrl)}`;
  }
  // onShareAppMessage() {
  //   return {
  //     title: this.title,
  //     path: `/pagesSub/public/web/index?title=${this.title}&link=${encodeURIComponent(this.linkUrl)}`,
  //   };
  // },
  // onShareTimeline() {
  //   return {
  //     title: this.title,
  //     path: `/pagesSub/public/web/index?title=${this.title}&link=${encodeURIComponent(this.linkUrl)}`,
  //   };
  // },
};
</script>

<style lang="scss">
.page-wrap {
  background: $uni-bg-color;
}
</style>
